package com.example.demo.client.vm.sysbasequery;

import com.example.demo.format.TreeFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.ibatis.type.Alias;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @Author zhengmf
 * @Date 2018/12/29  17:04
 */
@ApiModel("菜单管理页面")
@Alias("MenuTreeVm")
public class MenuTreeVm implements TreeFormat<MenuTreeVm, Long>, Serializable {
    private static final long serialVersionUID = 5073422858874195699L;
    @ApiModelProperty("菜单ID")
    private Long menuId;
    @ApiModelProperty("菜单名称")
    private String nameCn;
    @ApiModelProperty("菜单编码")
    private String nameEn;
    @ApiModelProperty("是否启用")
    private String enabled;
    @ApiModelProperty(" URL")
    private String url;
    @ApiModelProperty("url_type")
    private int urlType;
    @ApiModelProperty("父菜单ID")
    private Long parentId;
    @ApiModelProperty("菜单类型")
    private String menuType;
    @ApiModelProperty("菜单类型名称")
    private String menuTypeCn;
    @ApiModelProperty("权限码")
    private String permissionCode;
    @ApiModelProperty("菜单描述信息")
    private String menuDesc;
    @ApiModelProperty("菜单序号(排序字段).")
    private Integer menuIndex;
    @ApiModelProperty("菜单图标url")
    private String imageUrl;
    @ApiModelProperty("子菜单")
    private List<MenuTreeVm> children;

    @Override
    public Long getId() {
        return menuId;
    }

    @Override
    public Long getParentId() {
        return parentId;
    }

    @Override
    public void addChildren(MenuTreeVm child) {
        if (this.children == null) {
            this.children = new ArrayList<>();
        }
        this.children.add(child);
    }

    public Long getMenuId() {
        return menuId;
    }

    public void setMenuId(Long menuId) {
        this.menuId = menuId;
    }

    public String getNameCn() {
        return nameCn;
    }

    public void setNameCn(String nameCn) {
        this.nameCn = nameCn;
    }

    public String getNameEn() {
        return nameEn;
    }

    public void setNameEn(String nameEn) {
        this.nameEn = nameEn;
    }

    public String getEnabled() {
        return enabled;
    }

    public void setEnabled(String enabled) {
        this.enabled = enabled;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public int getUrlType() {
        return urlType;
    }

    public void setUrlType(int urlType) {
        this.urlType = urlType;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public String getMenuType() {
        return menuType;
    }

    public void setMenuType(String menuType) {
        this.menuType = menuType;
    }

    public String getMenuTypeCn() {
        return menuTypeCn;
    }

    public void setMenuTypeCn(String menuTypeCn) {
        this.menuTypeCn = menuTypeCn;
    }

    public String getPermissionCode() {
        return permissionCode;
    }

    public void setPermissionCode(String permissionCode) {
        this.permissionCode = permissionCode;
    }

    public String getMenuDesc() {
        return menuDesc;
    }

    public void setMenuDesc(String menuDesc) {
        this.menuDesc = menuDesc;
    }

    public Integer getMenuIndex() {
        return menuIndex;
    }

    public void setMenuIndex(Integer menuIndex) {
        this.menuIndex = menuIndex;
    }

    public String getImageUrl() {
        return imageUrl;
    }

    public void setImageUrl(String imageUrl) {
        this.imageUrl = imageUrl;
    }

    public List<MenuTreeVm> getChildren() {
        return children;
    }

    public void setChildren(List<MenuTreeVm> children) {
        this.children = children;
    }

    @Override
    public String toString() {
        return "MenuTreeVm{" +
                "menuId=" + menuId +
                ", nameCn='" + nameCn + '\'' +
                ", nameEn='" + nameEn + '\'' +
                ", enabled='" + enabled + '\'' +
                ", url='" + url + '\'' +
                ", urlType=" + urlType +
                ", parentId=" + parentId +
                ", menuType='" + menuType + '\'' +
                ", menuTypeCn='" + menuTypeCn + '\'' +
                ", permissionCode='" + permissionCode + '\'' +
                ", menuDesc='" + menuDesc + '\'' +
                ", menuIndex=" + menuIndex +
                ", imageUrl='" + imageUrl + '\'' +
                ", children=" + children +
                '}';
    }
}
